<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
        <script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
        <title>后台管理</title>
    </head>

    <body class="body_ifm">
        {yun:}include file="siteadmin/member_send_email.htm"{/yun}
        <div id="status_div" style="display:none; width: 350px; ">
            <div class="" style=" margin-top:10px; ">
                <form class="layui-form" action="index.php?m=admin_member&c=lock" target="supportiframe" method="post" id="lockform">
                    <table cellspacing='1' cellpadding='1' class="admin_examine_table">
                        <tr>
                            <th width="80">锁定操作：</th>
                            <td align="left">
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <div class="admin_examine_right">
                                            <input name="status" id="status1" value="1" title="正常" type="radio" />
                                            <input name="status" id="status2" value="2" title="锁定" type="radio" />
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>锁定说明：</th>
                            <td align="left"> <textarea id="alertcontent" name="lock_info" class="admin_explain_textarea"></textarea> </td>
                        </tr>
                        <tr>
                            <td colspan='2' align="center"><input type="button" value='确认' onClick="lockform();" class="admin_examine_bth">
                                <input type="button" id="zxxCancelBtn" onClick="layer.closeAll();" class="admin_examine_bth_qx" value='取消'></td>
                        </tr>
                    </table>
                        <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
                        <input name="uid" value="0" type="hidden">
                </form>
            </div>
        </div>
            <div id="status_usertype" style="display:none; width: 350px; ">
            <div class="" style=" margin-top:10px; ">
                <form class="layui-form" action="index.php?m=admin_member&c=userchange" target="supportiframe" method="post" id="typeform">
                    <table cellspacing='1' cellpadding='1' class="admin_examine_table">
                          <tr>
                            <th width="80">用户名：</th>
                            <td align="left">
                             <div id="username"></div>
                            </td>
                        </tr>
                         <tr>
                            <th width="80">当前会员：</th>
                            <td align="left">
                                <div id="usertypeid"></div>
                            </td>
                        </tr>
                        <tr>
                            <th width="80">转换会员：</th>
                            <td align="left">
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <div class="admin_examine_right">
                                            <input name="applyusertype" id="applyusertype" value="1" title="个人会员" type="radio" />
                                            <input name="applyusertype" id="applyusertype" value="2" title="企业会员" type="radio" />
                                            <input name="applyusertype" id="applyusertype" value="3" title="猎头会员" type="radio" />
                                            <input name="applyusertype" id="applyusertype" value="4" title="培训会员" type="radio" />
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                           <tr>
                            <th>转换说明：</th>
                            <td align="left"> <textarea id="statusbody" name="statusbody" class="admin_explain_textarea"></textarea> </td>
                        </tr>
                        <tr>
                            <td colspan='2' align="center"><input type="button" value='确认' onClick="typeform();" class="admin_examine_bth">
                                <input type="button" id="zxxCancelBtn" onClick="layer.closeAll();" class="admin_examine_bth_qx" value='取消'></td>
                        </tr>
                    </table>
                        <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
                        <input name="uid" id="uid" value="0" type="hidden">
                        <input name="usertype" id="usertype" value="0" type="hidden">
                </form>
            </div>
        </div>  
      
        <div class="infoboxp">
        
            <div class="admin_new_tip">
                <a href="javascript:;" class="admin_new_tip_close"></a>
                <a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
                <div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
                <div class="admin_new_tip_list_cont">
                    <div class="admin_new_tip_list">该页面展示了网站所有的会员信息，可对会员进行编辑修改操作。</div>
                    <div class="admin_new_tip_list">可输入名称关键字进行搜索，也可进行详细的高级搜索。</div>
                    <div class="admin_new_tip_list">当前会员为已审核状态，锁定相关会员状态显示为已锁定。</div>
                    <div class="admin_new_tip_list">其他状态(待审核,未通过),锁定相关会员,显示当前状态（待审核,未通过）。</div>
                    <div class="admin_new_tip_list">对会员进行审核操作，会员账户信息（个人，猎头，企业，培训）相关数据全部锁定。</div>
                </div>
            </div>
            <div class="clear"></div>
            <div class="admin_new_search_box">
                <form action="index.php" name="myform" method="get">
                    <input name="m" value="admin_member" type="hidden" />
                    <div class="admin_new_search_name">搜索类型：</div>
                    <div class="admin_Filter_text formselect" did='dkeytype'>
                        <input type="button" {yun:}if $smarty.get.keytype=='' ||$smarty.get.keytype=='1' {/yun} value="用户名" {yun:}elseif $smarty.get.keytype=='2' {/yun} value="手机号"{yun:}elseif $smarty.get.keytype=='3' {/yun} value="用户ID" {yun:}/if{/yun} class="admin_Filter_but" id="bkeytype">

                        <input type="hidden" name="type" id="keytype" {yun:}if $smarty.get.keytype=='' ||$smarty.get.keytype=='1' {/yun} value="1" {yun:}elseif $smarty.get.keytype=='2' {/yun} value="2" {yun:}elseif $smarty.get.keytype=='3' {/yun} value="3" {yun:}/if{/yun}/>
                        <div class="admin_Filter_text_box" style="display:none" id="dkeytype">
                            <ul>
                                <li>
                                    <a href="javascript:void(0)" onClick="formselect('1','keytype','用户名')">用户名</a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)" onClick="formselect('2','keytype','手机号')">手机号</a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)" onClick="formselect('3','keytype','用户ID')">用户ID</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <input type="text" value="" placeholder="请输入你要搜索的关键字" name='keyword' class="admin_new_text">
                    <input type="submit" value="搜索" name='search' class="admin_new_bth">
                    <a href="javascript:void(0)" onclick="$('.admin_screenlist_box').toggle();" class="admin_new_search_gj">高级搜索</a>
                </form>
                
                {yun:}include file="siteadmin/admin_search.htm"{/yun}
            </div>
            
            <div class="clear"></div>
            <div class="admin_statistics">
                  数据统计：
              <em class="admin_statistics_s">总数：<span class="ajaxall">0</span></em>
              <em class="admin_statistics_s">未审核：<span class="StatusNum1">0</span></em>
              <em class="admin_statistics_s">未通过：<span class="StatusNum2">0</span></em>
              <em class="admin_statistics_s">已锁定：<span class="StatusNum3">0</span></em>
              搜索结果：<span>{yun:}$total{/yun}</span>；
            </div>
            <div class="clear"></div>

            <div class="table-list">
                <div class="admin_table_border">
                    <iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
                    <form action="index.php?m=admin_member&c=del" target="supportiframe" name="myform" method="get" id='myform' class="layui-form">
                        <table width="100%">
                            <thead>
                                <tr class="admin_table_top">
                                    <th style="width:20px;">
                                      <label for="chkall"><input type="checkbox" id='chkAll'  lay-filter="allChoose" lay-skin="primary" /></label>
                                    </th>
                                    <th align="left"> 
                                      {yun:}if $smarty.get.t=="uid" && $smarty.get.order=="asc"{/yun}
                                        <a href="index.php?m=admin_member&order=desc&t=uid">用户ID<img src="images/sanj.jpg" /></a>
                                      {yun:}else{/yun}
                                        <a href="index.php?m=admin_member&order=asc&t=uid">用户ID<img src="images/sanj2.jpg" /></a> 
                                      {yun:}/if{/yun}
                                    </th>
                                    <th align="left">用户名</th>
                                    <th align="left">当前身份</th>
                                    <th align="left">手机号/邮箱</th> 
                                    <th align="left">登录/注册</th>  
                                    <th align="left">来源</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                {yun:}foreach item=v key=key from=$rows{/yun}
                                <tr {yun:}if ($key+1)%2=='0' {/yun}class="admin_com_td_bg" {yun:}/if{/yun} id="list{yun:}$v.uid{/yun}">
                                    <td width="20"><input type="checkbox" value="{yun:}$v.uid{/yun}" class="check_all" name='del[]' lay-filter="checklist" lay-skin="primary" rel="del_chk" style="margin-left:5px;;" /></td>

                                    <td align="left" class="td1" style="width:60px;">
                                        {yun:}$v.uid{/yun}
                                    </td>
                                    <td align="left">{yun:}$v.username{/yun}</td>
                                    <td align="left">{yun:}if $v.usertype && $v.pid<1{/yun}{yun:}if $v.usertype==1{/yun}个人会员{yun:}elseif $v.usertype==2{/yun}企业会员{yun:}elseif $v.usertype==3{/yun}猎头会员{yun:}elseif $v.usertype==4{/yun}培训会员{yun:}/if{/yun}
                                      <div class="mt5">
                                            <a href="javascript:;" onclick="checkusertype('{yun:}$v.pid{/yun}','{yun:}$v.moblie{/yun}','{yun:}$v.username{/yun}','{yun:}$v.uid{/yun}','{yun:}$v.usertype{/yun}');" class="admin_cz_sc">切换身份</a>
                                        </div>
                                        {yun:}/if{/yun}
                                    </td>
                                    
                                    <td align="left">
                                        <div>
                                           <span class="admin_new_sj">{yun:}$v.moblie{/yun}</span> 
                                        </div>
                                        <div>
                                           <span class="admin_new_yx">{yun:}$v.email{/yun}</span> 
                                        </div>
            
                                    </td>

                                    <td class="td" align="left">
                                    <div>{yun:}if $v.login_date!=""{/yun}{yun:}$v.login_date|date_format:"%Y-%m-%d"{/yun} 
                                    {yun:}else{/yun}<font color="#FF0000">从未登录</font>
                                    {yun:}/if{/yun}</div>
                                  <div>{yun:}$v.reg_date|date_format:"%Y-%m-%d"{/yun}</div>
                                    </td>
                                    <td class="td" align="left">{yun:}$source[$v.source]{/yun}</td>
                           
                                         <td align="center">{yun:}if $v.status=='1'{/yun}<span class="admin_com_Audited">已审核</span>{yun:}else{/yun}<span class="admin_com_Lock">已锁定</span>{yun:}/if{/yun}
                                    </td>
                                    <td align="center">
                                        <a href="javascript:;" class="admin_new_c_bth admin_new_c_bthsd status" pid="{yun:}$v.uid{/yun}" status="{yun:}$v.status{/yun}">锁定</a>
                                        <a href="index.php?m=admin_member&c=edit&uid={yun:}$v.uid{/yun}" class="admin_new_c_bth admin_n_sc mt5">修改</a><br>
                                        <a href="javascript:void(0);" onClick="resetpw('{yun:}$v.username{/yun}','{yun:}$v.uid{/yun}');" class="admin_new_c_bth admin_new_c_mmcz mt5">密码</a>
                                        <a href="javascript:void(0)" onClick="layer_del('确定要删除？', 'index.php?m=admin_member&c=del&del={yun:}$v.uid{/yun}');" class="admin_new_c_bth admin_new_c_bth_sc">删除</a>
                                    </td>
                                </tr>
                                {yun:}/foreach{/yun}
                                <tr>
                                    <td align="center"><input type="checkbox" id='chkAll2' lay-filter="allChoose"  lay-skin="primary" /></td>
                                    <td colspan="12"><label for="chkAll2">全选</label> &nbsp;
                                        <input class="admin_button" type="button" name="delsub" value="删除所选" onclick="return really('del[]')" />
                                    </td>
								</tr>	
								{yun:}if $total > $config.sy_listnum {/yun}
									<tr>
										{yun:}if $pagenum==1{/yun}
											<td colspan="3"> 从 1 到 {yun:}$config.sy_listnum {/yun} ，总共 {yun:}$total{/yun} 条</td>
										{yun:}else if $pagenum > 1 && $pagenum < $pages{/yun}
											<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$pagenum * $config.sy_listnum{/yun} ，总共 {yun:}$total{/yun} 条</td>
										{yun:}else if $pagenum == $pages{/yun}
											<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$total{/yun} ，总共 {yun:}$total{/yun} 条</td>
										{yun:}/if{/yun}
										<td colspan="10" class="digg">{yun:}$pagenav{/yun}</td>
									</tr>
								{yun:}/if{/yun}
                            </tbody>
                        </table>
                        <input type="hidden" name="pytoken" id='pytoken' value="{yun:}$pytoken{/yun}">
                    </form>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            layui.use(['layer', 'form'], function() {
                var layer = layui.layer,
                    form = layui.form,
                    $ = layui.$;
                form.on('checkbox(allChoose)', function (data) {//触发全选按钮，全体选中
                    $("input[name='del[]']").each(function () {
                        this.checked = data.elem.checked;
                    });
                    //针对上下文本框
                    if(data.elem.checked==true){
                      
                         $("#chkAll").prop("checked", true);
                         $("#chkAll2").prop("checked", true);
                    }else{
                         $("#chkAll").prop("checked", false);
                         $("#chkAll2").prop("checked", false);
                    }
                    form.render('checkbox');
                  });
               form.on('checkbox(checklist)', function (data) {//触发其中一个数据按钮   全选按钮自动取消选中
                  var item = $(".check_all");
                  for (var i = 0; i < item.length; i++) {
                    if (item[i].checked == false) {
                      $("#chkAll").prop("checked", false);
                       $("#chkAll2").prop("checked", false);
                      form.render('checkbox');
                       break;
                    }
                  } 
                  var all=item.length;//选择本页面   全选自动选中
                    for (var i = 0; i < item.length; i++) {
                        if (item[i].checked == true) {
                            all--;
                        }
                    }
                    if(all==0){
                      $("#chkAll").prop("checked", true);
                      $("#chkAll2").prop("checked", true);
                      form.render('checkbox');  
                    }
               
              });   
                    
                    
            });
            
            $(document).ready(function(){
              $.get("index.php?m=admin_member&c=memNum", function(data) {
                var datas = eval('(' + data + ')');
                if(datas.memAllNum) {
                  $('.ajaxall').html(datas.memAllNum);
                }
                if(datas.memStatusNum1) {
                  $('.StatusNum1').html(datas.memStatusNum1);
                }
                if(datas.memStatusNum2) {
                  $('.StatusNum2').html(datas.memStatusNum2);
                }
                if(datas.memStatusNum3) {
                  $('.StatusNum3').html(datas.memStatusNum3);
                }
             });
                $(".status").click(function() {
                    $("input[name=pid]").val($(this).attr("pid"));
                    var uid = $(this).attr("pid");
                    var status = $(this).attr("status");
                    $("#status" + status).attr("checked", true);
                    layui.use(['form'], function() {
                        var form = layui.form;
                        form.render();
                    });
                    $("input[name=uid]").val(uid);
                    $.get("index.php?m=admin_member&c=lockinfo&uid=" + uid, function(msg) {
                        $("#alertcontent").val($.trim(msg));
                        status_div('锁定用户', '350', '240');
                    });
                });
                $(".check").click(function() {
                    $("input[name=pid]").val($(this).attr("pid"));
                    var uid = $(this).attr("pid");
                    var status = $(this).attr("status");
                    $("#state" + status).attr("checked", true);
                    layui.use(['form'], function() {
                        var form = layui.form;
                        form.render();
                    });
                    $("input[name=uid]").val(uid);
                    $.get("index.php?m=admin_member&c=lockinfo&uid=" + uid, function(msg) {
                        $("#statusbody").val($.trim(msg));
                        $.layer({
                            type: 1,
                            title: '用户审核',
                            closeBtn: [0, true],
                            border: [10, 0.3, '#000', true],
                            area: ['390px', '240px'],
                            page: {
                                dom: "#info_div"
                            }
                        });
                    });
                });
              });
              function lockform(){
                loadlayer();
                $('#lockform').submit()
              }
              function statusform(){
                loadlayer();
                $('#statusform').submit()
              }
              
              function resetpw(uname,uid){
                var pytoken = $('#pytoken').val();
                var pwcf = parent.layer.confirm("确定要重置密码吗？",function(){
                  $.get("index.php?m=admin_member&c=reset_pw&uid="+uid+"&pytoken="+pytoken,function(data){
                    parent.layer.close(pwcf);
                    loadlayer();
                    parent.layer.alert("用户："+uname+" 密码已经重置为123456！", 9);
                    parent.layer.closeAll('loading');
                    
                  });
                });
              }
                            function checkusertype(pid,moblie,username,uid,usertype){
                if(pid>0){
                  parent.layer.msg('子账号不能转换身份！', 2, 8);return false;
                }else{
                    if(usertype==1){
                      $("#usertypeid").html('个人会员');
                    }else if(usertype==2){
                      $("#usertypeid").html('企业会员');
                    }else if(usertype==3){
                      $("#usertypeid").html('猎头会员');
                    }else if(usertype==4){
                      $("#usertypeid").html('培训会员');
                    }
                    $("input[name=uid]").val(uid);
                    $("input[name=moblie]").val(moblie);
                    $("input[name=usertype]").val(usertype);
                    $("#username").html(username);
                    	$.layer({
                        type : 1,
                        title :'切换身份',
                        closeBtn : [0 , true],
                        border : [10 , 0.3 , '#000', true],
                        area : ['350px','340px'],
                        page : {dom :"#status_usertype"}
                      });
  
                }
                
              }

        </script>
        {yun:}include file="siteadmin/checkdomain.htm"{/yun}
    </body>

</html>